$(document).ready(function() {
	/*=========================================对某课程题目信息进行分页=============================================*/
	  var numberOfPages;
	    if ($("#totalPages").html() < 5) {
	        numberOfPages = $("#totalPages").html();

	    } else {
	        numberOfPages = 5;
	    }
	    if($("#totalPages").html() !=0){
	    var options = {
	        currentPage: $("#currentPage").html(),
	        totalPages: $("#totalPages").html(),
	        numberOfPages: numberOfPages,
	        alignment: "center",
	        onPageClicked: function(e, originalEvent, type, page) {
	        	if($("#currentCocourseCode").html()==""){
	        		location.href="/Examination/admin/courser/selectTopicByCourse?page="+page;
	            }
	        	else
	        		{
	        		var cocourseCode = $("#courseName option:selected").val();
	        	    var cid = $("#classes option:selected").val();
	        		location.href="/Examination/admin/courser/selectTopicByCourse?cocourseCode=" + cocourseCode + "&page=" + page;
	        		}
	        }
	  
	    };

	    $('#example').bootstrapPaginator(options);
	    /*=======================================显示从后台传过来的课程代码===============================*/
	    var currentCocourseCode = $("#currentCocourseCode").html();
	    $("#courseName").val(currentCocourseCode);
	    }
	    /*===================================按照课程选择试题信息===============================*/
	    $("#selsect").click(function(){
	    	location.href="/Examination/admin/courser/selectTopicByCourse?page=1&cocourseCode="+$("#courseName").val();
	    	
	    })
});